﻿// TestCaseGeneratorUI
// (c)2007 Mark Bulmahn. mBulmahn@web.de
// License: GPL 2.0
// Project: TestCaseGenerator. http://www.codeplex.com/TestCaseGenerator

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using TestCaseModel;

namespace TestCaseGenerator
{
    public partial class FrmEditResult : Form
    {
        ExpectedResult testResult = null;
        public ExpectedResult TestResult
        {
            get { return testResult; }
            set { testResult = value; }
        }

        public FrmEditResult(ExpectedResult res)
        {
            InitializeComponent();
            this.testResult = res;
            textId.Text = res.Id;
            textDesc.Text = res.Desc;
            cboResultType.Text = res.ResTypeText;

            cboResultType.Items.Add(ExpectedResult.GetResultTypeText
                (ExpectedResult.ResultType.General));
            cboResultType.Items.Add(ExpectedResult.GetResultTypeText
                (ExpectedResult.ResultType.ErrorMessage));
            cboResultType.Items.Add(ExpectedResult.GetResultTypeText
                (ExpectedResult.ResultType.NegativeResult));
        }

        private void butOK_Click(object sender, EventArgs e)
        {
            testResult.Id = textId.Text;
            testResult.Desc = textDesc.Text;
            this.Close();
        }

        private void butCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void cboResultType_SelectedIndexChanged(object sender, EventArgs e)
        {

        }
    }
}
